#include <iostream>
#include <fstream>
using std::cout;
using std::endl;
using std::string;
using std::ifstream;
using std::cerr;

void test0(){
    ifstream ifs;
    ifs.open("test.cc");

    ifs.seekg(0,std::ios::end);
    long length = ifs.tellg();
    cout << length << endl;

    ifs.seekg(0,std::ios::beg);
    char* pdata = new char[length + 1]();
    ifs.read(pdata,length);

    cout << "test:" << endl;
    cout << pdata << endl;

    delete [] pdata;

    ifs.close();
}

int main(int argc, char * argv[])
{
    test0();
    return 0;
}


